package com.congwulin.wechat.service;

import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(url = "${weatherApi.url}",name="weather")
public interface WeChatWeatherService {
    @RequestMapping(value="/v3/location/search.json",method = RequestMethod.GET)
    public JSONObject getCityId(@RequestParam("key") String key, @RequestParam("q") String cityname);

    @RequestMapping(value="/v3/weather/now.json",method = RequestMethod.GET)
    public JSONObject getNowWeather(@RequestParam("key") String key,@RequestParam("location") String id,@RequestParam("language") String language,@RequestParam("unit") String unit);
}
